#include "blktrans.h"

namespace gcode {

	BlockTranslator::BlockTranslator(CommandDatabase &cmddb) : cmddb_(cmddb)
	{
	}

	CommandList BlockTranslator::getCommandList(Block block)
	{
		for (Word *word = block.begin(); word != block.end(); word++) {
			if (WordFormat *wf = cmddb_.isCommandAddress(*word)) {
				if (wf->check(*word)) {
					CommandFormat cf = cmddb_.getCommandFormat(*word);
					for (WordFormat *wfParam = cf.begin(); wfParam != cf.end(); wfParam++)
						;
				} // else error
			}
			//cout << "word: (" <<  word->getAddress() << ", " << word->getValue() << ")" << endl;
		}
		return CommandList();
	}

} // namespace gcode
